package com.heima.wemedia.fegin;

import com.heima.api.feign.WmChannelFeginClient;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.pojos.WmChannel;
import com.heima.model.wemedia.pojos.WmNews;
import com.heima.wemedia.service.WmNewsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * TODO
 *
 * @Author mr.zhao
 * @Date 2025/6/27 21:05
 */
@RestController
public class WmNewsClient implements WmChannelFeginClient {
	@Autowired
	private WmNewsService wmNewsService;

	/**
	 * 查询频道列表
	 *
	 * @return
	 */
	@Override
	@GetMapping("/api/v1/channel/channels/init")
	public ResponseResult<List<WmChannel>> list() {
		return null;
	}

	/**
	 * 查询文章列表
	 *
	 * @param dto
	 * @return
	 */
	@PostMapping("/list/one")
	@Override
	public WmNews getByArticalId(Long id) {
		return wmNewsService.getByArticalId(id);
	}
}
